import request from "@/utils/request";

export function apiGetList(params: any) {
  return request({
    url: "/api/v1/model/list",
    method: "get",
    params,
  });
}

export function getModel(modelId: number) {
  return request({
    url: "/api/v1/model/info/" + modelId,
    method: "get",
  });
}

export function addModel(data: any) {
  return request({
    url: "/api/v1/model/edit",
    method: "post",
    data,
  });
}

export function updateModel(data: any) {
  return request({
    url: "/api/v1/model/edit",
    method: "post",
    data,
  });
}

export function delModel(modelId: number) {
  return request({
    url: "/api/v1/model/delete/" + modelId,
    method: "delete",
  });
}

export function apiUserModelList(params: any) {
  return request({
    url: "/api/v1/model/user_model_list",
    method: "get",
    params,
  });
}

export function apiModelInstall(data: any) {
  return request({
    url: "/api/v1/model/install",
    method: "post",
    data,
  });
}

export function apiModelUninstall(modelId: any) {
  return request({
    url: "/api/v1/model/delete_user_model/" + modelId,
    method: "delete",
  });
}

export function apiModelUpdateCount(data: any) {
  return request({
    url: "/api/v1/model/edit_user_model",
    method: "post",
    data,
  });
}

export function apiCallModel(data: any) {
  return request({
    url: "/api/v1/model/protocol",
    method: "post",
    data,
  });
}
